<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./a.js" type="text/javascript"> </script>
    <style>
        div{
            position: absolute;
        }
    </style>
</head>
<body>
    <div>left:30px ; top:20px</div>
    <script>
        var divEle = document.querySelector("div");
        document.onmousemove = function(e){
            var e = e || window.event;
            var x = e.clientX ;
            var y = e.clientY;
            var str = "left:"+ x + "px;"+"top:"+y+"px";
            divEle.innerHTML = str;
            divEle.style.left = x + "px";
            divEle.style.top = y + "px";
        }


    </script>
</body>
</html>